package com.mrdeer.iot.constant;

public class FrameConst {
    /**
     * 接收报文最短长度(无数据内容无校验)
     */
    public static final int acceptMinMsgLength = 10;
    /**
     * 接收报文最大长度
     */
    public static final int acceptMaxMsgLength = 1024;

    /**
     * 报文最短长度
     */
    public static final int sendMinMsgLength = 9;

    /**
     * 帧头字段长度
     */
    public static final int headFieldLength = 1;

    /**
     * 类型字段长度
     */
    public static final int typeFieldLength = 1;

    /**
     * 消息长度字段的长度
     * 整个帧的长度
     */
    public static final int msgFieldLength = 2;

    /**
     * 最大能忍受多长时间未收到心跳
     */
    public static final int maxIdleTime = 420;

    /**
     * 帧头
     */
    public static final byte header = 0x68;

    //6810000000000001026d010000000000000045ed 心跳指令
    public static final String control = "01";     //控制或设置数据       模块->设备
    public static final String status = "02";     //状态返回数据         设备->模块
    public static final String invalid = "03";     //无效命令(Invalid)    设备->模块
    public static final String heartbeat = "04";     //心跳报文(ACK)         设备<->模块
    /**
     * 请求类型
     */
    public static final String[] req_types = {control, status, invalid, heartbeat};

    public static final byte[] crcs = {0x01, 0x02};
}
